#include<cstdio>
int main(){
	char a[200];
	gets(a);
	int count=0;
	int count1=0;
	while(a[count]!='\0'){
		if((a[count]=='e' && a[count+1]=='r') ||(a[count]=='E'&&a[count+1]=='r')||(a[count]=='E'&&a[count+1]=='R')||(a[count]=='e'&&a[count+1]=='R')){
			count1++;
		}
		count++;
	}
	printf("%3d",count1);
} 
